package com.squirrel.common.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.squirrel.common.entity.Video;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.squirrel.common.vo.video.VideoInfoVO;
import com.squirrel.common.vo.video.VideoUpVO;
import com.squirrel.common.vo.video.VideoVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * VideoMapper 视频接口
 * </p>
 *
 * @author 关远键
 * @since 2021/11/11 16:06
 */
@Repository
public interface VideoMapper extends BaseMapper<Video> {

    IPage<VideoVO> getRandomVideo(Page<VideoVO> page);

    IPage<VideoVO> getByChannel(Page<VideoVO> page, @Param("channelId") Integer channelId);

    IPage<VideoVO> getByKey(Page<VideoVO> page, @Param("key") String key);
//    List<VideoVO> getByKey(@Param("key") String key);

    List<VideoVO> getByUserId(Page<VideoVO> page, @Param("userId") Integer userId);

    List<VideoUpVO> getByAuthor(@Param("authorId") Integer authorId);

    VideoInfoVO getByVideoId(@Param("id") Integer id);
}
